﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Globalization;
using System.Collections.ObjectModel;

namespace NobleTech.Products.CreatureKingdom.WPFClient.Controls
{
    public class MapOrganisms : ObservableCollection<MapOrganism>
    {
        public MapOrganisms() { }

        public MapOrganisms(IEnumerable<MapOrganism> items)
        {
            foreach (var item in items)
                Add(item);
        }
    }

    public class MapOrganism : DependencyObject
    {
        public Guid ID
        {
            get { return (Guid)GetValue(IDProperty); }
            set { SetValue(IDProperty, value); }
        }

        // Using a DependencyProperty as the backing store for ID.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IDProperty =
            DependencyProperty.Register("ID", typeof(Guid), typeof(MapOrganism));


        public double PositionX
        {
            get { return (double)GetValue(PositionXProperty); }
            set { SetValue(PositionXProperty, value); }
        }

        // Using a DependencyProperty as the backing store for PositionX.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PositionXProperty =
            DependencyProperty.Register("PositionX", typeof(double), typeof(MapOrganism), new UIPropertyMetadata(0d));


        public double PositionY
        {
            get { return (double)GetValue(PositionYProperty); }
            set { SetValue(PositionYProperty, value); }
        }

        // Using a DependencyProperty as the backing store for PositionY.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PositionYProperty =
            DependencyProperty.Register("PositionY", typeof(double), typeof(MapOrganism), new UIPropertyMetadata(0d));

        public double Size
        {
            get { return (double)GetValue(SizeProperty); }
            set { SetValue(SizeProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Size.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty SizeProperty =
            DependencyProperty.Register("Size", typeof(double), typeof(MapOrganism), new UIPropertyMetadata(1d));

        public double DirectionFacing
        {
            get { return (double)GetValue(DirectionFacingProperty); }
            set { SetValue(DirectionFacingProperty, value); }
        }

        // Using a DependencyProperty as the backing store for DirectionFacing.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty DirectionFacingProperty =
            DependencyProperty.Register("DirectionFacing", typeof(double), typeof(MapOrganism), new UIPropertyMetadata(0d));


        public bool IsAlive
        {
            get { return (bool)GetValue(IsAliveProperty); }
            set { SetValue(IsAliveProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IsAlive.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsAliveProperty =
            DependencyProperty.Register("IsAlive", typeof(bool), typeof(MapOrganism), new UIPropertyMetadata(true));



        public Brush Texture
        {
            get { return (Brush)GetValue(TextureProperty); }
            set { SetValue(TextureProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Texture.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextureProperty =
            DependencyProperty.Register("Texture", typeof(Brush), typeof(MapOrganism), new UIPropertyMetadata(new SolidColorBrush(Colors.Red)));




        public string Name
        {
            get { return (string)GetValue(NameProperty); }
            set { SetValue(NameProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Name.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty NameProperty =
            DependencyProperty.Register("Name", typeof(string), typeof(MapOrganism));


    }

}
